package org.neuedu.chapter09_0701.demo02;

import java.util.Calendar;
import java.util.Date;

public class CalendarDemo02 {
    public static void main(String[] args) {
        // 通过静态方法 getInstance 获取 Calendar 子类对象
        Calendar calendar = Calendar.getInstance();
        calendar.set(2020,7,8,0,0,0);
        System.out.println(calendar.getTime());
        System.out.println(calendar.get(Calendar.DAY_OF_YEAR));

        Date date1 = new Date();
        Calendar calendar1 = Calendar.getInstance();
        calendar1.setTime(date1);
    }
}
